//
//  SelectJobCell.m
//  Btpin
//
//  Created by Vic on 2019/4/21.
//  Copyright © 2019 Vic. All rights reserved.
//

#import "SelectJobCell.h"

@interface SelectJobCell ()
{
    UILabel *leftLbl;
    UIImageView *imgView;
}
@end

@implementation SelectJobCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self initUI];
    }
    return self;
}
- (void)initUI {
    leftLbl = [UIToolsControl initLabelWithFrame:CGRectMake(LeftSpace, 0, WIDTH-30*Scale, 50*Scale) text:nil textColor:THEMECOLOR_OF_TEXT_333333 font:Font_15];
    [self.contentView addSubview:leftLbl];
    
    imgView = [UIToolsControl initImageViewWithFrame:CGRectMake(WIDTH-30*Scale, 17.5*Scale, 15*Scale, 15*Scale) imageName:@"privacysetting_main_n"];
    imgView.userInteractionEnabled = NO;
    [self.contentView addSubview:imgView];
}
- (void)reloadDataForModel:(CompanyJobModel *)model {
    NSString *job = model.title;
    NSString *text = [NSString stringWithFormat:@"%@  %@", model.title, model.wage_cn];
    NSMutableAttributedString *integrityAtt = [[NSMutableAttributedString alloc] initWithString:text];
    [integrityAtt addAttribute:NSForegroundColorAttributeName value:THEMECOLOR_OF_TEXT_9a9a9a range:NSMakeRange(0, text.length)];
    [integrityAtt addAttribute:NSForegroundColorAttributeName value:THEMECOLOR_OF_TEXT_333333 range:NSMakeRange(0, job.length)];
    leftLbl.attributedText = integrityAtt;
    
    imgView.image = [UIImage imageNamed:(model.isSelect?@"privacysetting_main_s":@"privacysetting_main_n")];
}
- (void)reloadDataForModelIM:(InterviewBaseinfoJobModel *)model {
    NSString *job = model.title;
    NSString *text = [NSString stringWithFormat:@"%@%@", model.title, model.wage_cn];
    NSMutableAttributedString *integrityAtt = [[NSMutableAttributedString alloc] initWithString:text];
    [integrityAtt addAttribute:NSForegroundColorAttributeName value:THEMECOLOR_OF_TEXT_9a9a9a range:NSMakeRange(0, text.length)];
    [integrityAtt addAttribute:NSForegroundColorAttributeName value:THEMECOLOR_OF_TEXT_333333 range:NSMakeRange(0, job.length)];
    leftLbl.attributedText = integrityAtt;
    
    imgView.image = [UIImage imageNamed:(model.isSelect?@"privacysetting_main_s":@"privacysetting_main_n")];
}

- (void)awakeFromNib {
    [super awakeFromNib];
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
}

@end
